<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>uniapp 视频</title>
  <style>
    html,
    body,
    #videoElement {
      height: 100%;
      width: 100%;
      padding: 0;
      margin: 0;
    }

    #videoElement {
      background-color: #333;
    }
  </style>
</head>

<body>
  <div id="videoElement" width="100%" height="100%"></div>
  <script src="./jessibuca.js"></script>
  <script>
    let videoElement = document.getElementById('videoElement')
    let player = new window.Jessibuca({
      decoder: './decoder.js',
      container: videoElement,
      isFlv: true,
      isResize: false,
      text: '',
      loadingText: '加载中',
      hasAudio: false,
      debug: false,
      timeout: 120,
      showBandwidth: true, // 显示网速
      vod: false,
      forceNoOffscreen: true,
      isNotMute: false,
      operateBtns: {
        fullscreen: true
      }
    });

    player.on("fullscreen", function (flag) {
      if (flag === true) {
        // 横屏
        plus.screen.lockOrientation("landscape-primary")
      } else {
        // 竖屏
        plus.screen.lockOrientation("portrait-primary")
      }
    })

    function getUrlAndPlay (url) {
      player.play(url)
    }
  </script>

</body>

</html>